package com.cleaningcloud.cld.mapper;

import java.util.List;
import com.cleaningcloud.cld.domain.CldRegularPlan;
import com.cleaningcloud.cld.domain.CldRegularPlanDetails;
import com.cleaningcloud.cld.domain.CldRegularSubmit;
import com.cleaningcloud.cld.domain.dto.CldRegularPlanDto;
import com.cleaningcloud.cld.domain.vo.CldRegularPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

/**
 * 例会计划Mapper接口
 * 
 * @author cleaningcloud
 * @date 2025-01-13
 */
public interface CldRegularPlanMapper 
{
    /**
     * 查询例会计划
     * 
     * @param regularPlanId 例会计划主键
     * @return 例会计划
     */
    public CldRegularPlanVo selectCldRegularPlanByRegularPlanId(Long regularPlanId);

    /**
     * 查询例会计划列表
     * 
     * @param cldRegularPlan 例会计划
     * @return 例会计划集合
     */
    public List<CldRegularPlanVo> selectCldRegularPlanList(CldRegularPlan cldRegularPlan);

    /**
     * 新增例会计划
     * 
     * @param cldRegularPlan 例会计划
     * @return 结果
     */
    public int insertCldRegularPlan(CldRegularPlanDto cldRegularPlanDto);

    /**
     * 修改例会计划
     * 
     * @param cldRegularPlan 例会计划
     * @return 结果
     */
    public int updateCldRegularPlan(CldRegularPlanDto cldRegularPlanDto);

    /**
     * 删除例会计划
     * 
     * @param regularPlanId 例会计划主键
     * @return 结果
     */
    public int deleteCldRegularPlanByRegularPlanId(Long regularPlanId);

    /**
     * 批量删除例会计划
     * 
     * @param regularPlanIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteCldRegularPlanByRegularPlanIds(Long[] regularPlanIds);

    /**
     * 批量新增例会明细
     * @param list
     * @return
     */
    public int batchInsertRegularDetails(List<CldRegularPlanDetails> list);

    /**
     * 批量新增例会计划提交明细
     * @param list
     * @return
     */
    public int batchInsertRegularSubmit(List<CldRegularSubmit> list);


    /**
     * 批量删除例会明细
     * @param regularPlanId
     */
    @Delete("delete from cld_regular_plan_details where regular_plan_id = #{regularPlanId}")
    void deleteCldRegularPlanDetails(@Param("regularPlanId") Long regularPlanId);

    /**
     * 批量删除例会提交明细
     * @param regularPlanId
     */
    @Delete("delete from cld_regular_submit where regular_plan_id = #{regularPlanId}")
    void deleteCldRegularPlanSubmit(@Param("regularPlanId") Long regularPlanId);
}
